-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add webassembly build #70697
add webassembly build #70697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-requesting reviews from non-collaborators: @Qrox
I suppose loading custom mods and config folder would be non-trivial? |
It's not out of the question, within the limitations of the browser (i.e. you'd have to specifically give the browser access to those folders), but I think it's out of scope for the first pass at this. |
emsdk install 3.1.51 | ||
emsdk activate 3.1.51 | ||
|
||
make -j`nproc` NATIVE=emscripten BACKTRACE=0 TILES=1 TESTS=0 RUNTESTS=0 RELEASE=1 cataclysm-tiles.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious if ccache works with emcc so we can reduce build times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is definitely worth looking into.
- name: Assemble web bundle | ||
run: ./build-scripts/prepare-web.sh | ||
|
||
- name: Create artifact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since #70870 is now uploading WebAssembly builds, should we remove this step here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still handy for development—the emscripten SDK doesn't work well on macOS or Windows, so it's handy to be able to download the built artifact from CI for testing. I'm not aware of any major downsides to uploading it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought upload-artifact
shares the total GitHub Actions storage limit of the repository, so too many build artifact uploads could evict other data like ccache.
But I just re-checked GitHub Actions doc and it only says GitHub Actions storage usage is free for public repositories without mentioning storage limits or data eviction policy, so I'm not too sure now.
CI artifacts get deleted after 30 days too I think
j
…On Sun, Jan 14, 2024 at 18:50 Binrui Dong ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .github/workflows/emscripten.yml
<#70697 (comment)>
:
> +
+ steps:
+ - uses: ***@***.***
+
+ - uses: ***@***.***
+
+ - name: Prepare web data
+ run: ./build-scripts/prepare-web-data.sh
+
+ - name: Build with emcc (emscripten)
+ run: ./build-scripts/build-emscripten.sh
+
+ - name: Assemble web bundle
+ run: ./build-scripts/prepare-web.sh
+
+ - name: Create artifact
I thought upload-artifact shares the total storage limit of the
repository, so too many build artifact uploads could evict other data like
ccache.
But I just re-checked GitHub Actions doc and it only says GitHub Actions
storage usage is free for public repositories without mentioning storage
limits or data eviction policy, so I'm not too sure now.
—
Reply to this email directly, view it on GitHub
<#70697 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKGABUUVH4XERVP7BKOFTYOSKQTAVCNFSM6AAAAABBPIMUFKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMRQGU4DEMRRGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
add webassembly build
Summary
Build "Added WebAssembly build via Emscripten"
Purpose of change
It's handy to be able to run Cataclysm in a browser :3
Describe the solution
This is a continuation of work done by @rameshvarun in https://github.com/rameshvarun/cdda-web, updated to modern versions of Cataclysm and Emscripten, and cleaned up somewhat.
You can try it out at https://nornagon.github.io/play-cdda/.
I'd like to bring this in-tree. The state of this PR is still draft as I'm not sure what the best way is to handle the html/js parts of this (should those live in this repo, or somewhere else?) and because there are a couple more bugs I'd like to iron out
(e.g. pressing ESC on the title screen still pops up the quit menu, even though the web version isn't quittable).Describe alternatives you've considered
I could keep this as a floating patchset and build in a separate repo.
Testing
I haven't done any automated testing but you can try it out at https://nornagon.github.io/play-cdda/. I haven't tested extensively.
Additional context